install Ubuntu on WSL

Here’s how you can install Ubuntu on WSL (Windows Subsystem for Linux) in Windows 11:


🖥️ Step 1: Enable WSL

Open PowerShell as Administrator and run:

wsl --install
  • This installs WSL with the default Linux distribution (usually Ubuntu).
  • If WSL is already installed, you can skip this step.

🐧 Step 2: Install Ubuntu specifically

If you want to install Ubuntu explicitly:

wsl --install -d Ubuntu
  • -d specifies the distribution.
  • Other available versions include Ubuntu-20.04 or Ubuntu-22.04.
    Example:
wsl --install -d Ubuntu-22.04

🔄 Step 3: Restart and Setup

  • Restart your computer if prompted.
  • Launch Ubuntu from the Start Menu or by typing wsl in PowerShell.
  • On first launch, you’ll be asked to create a username and password for your Linux environment.

⚡ Step 4: Update Ubuntu

Once inside Ubuntu, run:

sudo apt update && sudo apt upgrade -y

This ensures your packages are up to date.


👉 Tip: You can check which distros are available with:

wsl --list --online

Would you like me to show you a comparison table of Ubuntu versions (20.04 vs 22.04) so you can decide which one fits best for your workflow?

Also See

File5FileLast Modified
在WSL 中安裝 Ubuntu在WSL 中安裝 Ubuntu2:25 PM - January 12, 2026
Windows 上透過 WSL 進入 Ubuntu shellWindows 上透過 WSL 進入 Ubuntu shell2:25 PM - January 12, 2026
Restart DockerRestart Docker2:25 PM - January 12, 2026
Force restart WSLForce restart WSL2:25 PM - January 12, 2026
set WSL’s default distributionset WSL’s default distribution3:14 PM - December 15, 2025